home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / Balloons.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  8.3 KB  |  342 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Balloons.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__BALLOONS__') = 'UNDEFINED' THEN
  18. __BALLOONS__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24. ;        include 'ConditionalMacros.a'                                ;
  25.  
  26.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  27.     include 'Quickdraw.a'
  28.     ENDIF
  29. ;        include 'MixedMode.a'                                        ;
  30. ;        include 'QuickdrawText.a'                                    ;
  31.  
  32.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  33.     include 'Menus.a'
  34.     ENDIF
  35. ;        include 'Memory.a'                                            ;
  36. ;        include 'Events.a'                                            ;
  37. ;            include 'OSUtils.a'                                    ;
  38.  
  39.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  40.     include 'TextEdit.a'
  41.     ENDIF
  42.  
  43.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  44.     include 'Errors.a'
  45.     ENDIF
  46.  
  47. hmBalloonHelpVersion            EQU        $0002                ; The real version of the Help Manager 
  48. kHMHelpMenuID                    EQU        -16490                ; Resource ID and menu ID of help menu 
  49. kHMAboutHelpItem                EQU        1                    ; help menu item number of About Balloon Help… 
  50. kHMShowBalloonsItem                EQU        3                    ; help menu item number of Show/Hide Balloons 
  51. kHMHelpID                        EQU        -5696                ; ID of various Help Mgr package resources (in Pack14 range) 
  52. kBalloonWDEFID                    EQU        126                    ; Resource ID of the WDEF proc used in standard balloons 
  53. ; Dialog item template type constant 
  54. helpItem                        EQU        1                    ; key value in DITL template that corresponds to the help item 
  55. ; Options for Help Manager resources in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources 
  56. hmDefaultOptions                EQU        0                    ; default options for help manager resources 
  57. hmUseSubID                        EQU        1                    ; treat resID's in resources as subID's of driver base ID (for Desk Accessories) 
  58. hmAbsoluteCoords                EQU        2                    ; ignore window port origin and treat rectangles as absolute coords (local to window) 
  59.  
  60. hmSaveBitsNoWindow                EQU        4                    ; don't create a window, just blast bits on screen. No update event is generated 
  61. hmSaveBitsWindow                EQU        8                    ; create a window, but restore bits behind window when window goes away & generate update event 
  62. hmMatchInTitle                    EQU        16                    ; for hwin resources, match string anywhere in window title string 
  63. ; Constants for Help Types in 'hmnu', 'hdlg', 'hrct', 'hovr', & 'hfdr' resources 
  64. kHMStringItem                    EQU        1                    ; pstring used in resource 
  65. kHMPictItem                        EQU        2                    ; 'PICT' ResID used in resource 
  66. kHMStringResItem                EQU        3                    ; 'STR#' ResID & index used in resource 
  67. kHMTEResItem                    EQU        6                    ; Styled Text Edit ResID used in resource ('TEXT' & 'styl') 
  68. kHMSTRResItem                    EQU        7                    ; 'STR ' ResID used in resource 
  69. kHMSkipItem                        EQU        256                    ; don't display a balloon 
  70. kHMCompareItem                    EQU        512                    ; Compare pstring in menu item w/ PString in resource item ('hmnu' only) 
  71. kHMNamedResourceItem            EQU        1024                ; Use pstring in menu item to get 'STR#', 'PICT', or 'STR ' resource ('hmnu' only) 
  72. kHMTrackCntlItem                EQU        2048                ; Reserved 
  73. ; Constants for hmmHelpType's when filling out HMMessageRecord 
  74. khmmString                        EQU        1                    ; help message contains a PString 
  75. khmmPict                        EQU        2                    ; help message contains a resource ID to a 'PICT' resource 
  76. khmmStringRes                    EQU        3                    ; help message contains a res ID & index to a 'STR#' resource 
  77. khmmTEHandle                    EQU        4                    ; help message contains a Text Edit handle 
  78. khmmPictHandle                    EQU        5                    ; help message contains a Picture handle 
  79. khmmTERes                        EQU        6                    ; help message contains a res ID to 'TEXT' & 'styl' resources 
  80. khmmSTRRes                        EQU        7                    ; help message contains a res ID to a 'STR ' resource 
  81. kHMEnabledItem                    EQU        0                    ; item is enabled, but not checked or control value = 0 
  82.  
  83. ; ResTypes for Styled TE Handles in Resources 
  84. kHMTETextResType                EQU        'TEXT'                ; Resource Type of text data for styled TE record w/o style info 
  85. kHMTEStyleResType                EQU        'styl'
  86.  
  87. kHMDisabledItem                    EQU        1                    ; item is disabled, grayed in menus or disabled in dialogs 
  88. kHMCheckedItem                    EQU        2                    ; item is enabled, and checked or control value = 1 
  89. kHMOtherItem                    EQU        3                    ; item is enabled, and control value > 1 
  90. ; Method parameters to pass to HMShowBalloon 
  91. kHMRegularWindow                EQU        0                    ; Create a regular window floating above all windows 
  92. kHMSaveBitsNoWindow                EQU        1                    ; Just save the bits and draw (for MDEF calls) 
  93. kHMSaveBitsWindow                EQU        2                    ; Regular window, save bits behind, AND generate update event 
  94.  
  95. ; Resource Types for whichType parameter used when extracting 'hmnu' & 'hdlg' messages 
  96. kHMMenuResType                    EQU        'hmnu'                ; ResType of help resource for supporting menus 
  97. kHMDialogResType                EQU        'hdlg'                ; ResType of help resource for supporting dialogs 
  98. kHMWindListResType                EQU        'hwin'                ; ResType of help resource for supporting windows 
  99. kHMRectListResType                EQU        'hrct'                ; ResType of help resource for rectangles in windows 
  100. kHMOverrideResType                EQU        'hovr'                ; ResType of help resource for overriding system balloons 
  101. kHMFinderApplResType            EQU        'hfdr'
  102.  
  103. HMStringResType         RECORD    0
  104. hmmResID                 ds.w    1
  105. hmmIndex                 ds.w    1
  106. sizeof                     EQU    4
  107.                         ENDR
  108.  
  109. HMMessageRecord         RECORD    0
  110. hmmHelpType                 ds.w    1
  111. VariantLevel0Begin        EQU    *
  112. hmmString                 ds.l    64
  113.                         ORG        VariantLevel0Begin
  114. hmmPict                     ds.w    1
  115.                         ORG        VariantLevel0Begin
  116. hmmTEHandle                 ds.l    1
  117.                         ORG        VariantLevel0Begin
  118. hmmStringRes             ds        HMStringResType
  119.                         ORG        VariantLevel0Begin
  120. hmmPictRes                 ds.w    1
  121.                         ORG        VariantLevel0Begin
  122. hmmPictHandle             ds.l    1
  123.                         ORG        VariantLevel0Begin
  124. hmmTERes                 ds.w    1
  125.                         ORG        VariantLevel0Begin
  126. hmmSTRRes                 ds.w    1
  127. sizeof                     EQU    258
  128.                         ENDR
  129.  
  130. ;  Public Interfaces  
  131.     IF GENERATING68K THEN
  132.         Macro
  133.         _HMGetHelpMenuHandle
  134.             move.w    #$0200,d0
  135.             dc.w     $A830
  136.         EndM
  137.     ELSE
  138.         IMPORT    HMGetHelpMenuHandle
  139.     ENDIF
  140.  
  141.     IF GENERATING68K THEN
  142.         Macro
  143.         _HMShowBalloon
  144.             move.w    #$0B01,d0
  145.             dc.w     $A830
  146.         EndM
  147.     ELSE
  148.         IMPORT    HMShowBalloon
  149.     ENDIF
  150.  
  151.     IF GENERATING68K THEN
  152.         Macro
  153.         _HMRemoveBalloon
  154.             move.w    #$0002,d0
  155.             dc.w     $A830
  156.         EndM
  157.     ELSE
  158.         IMPORT    HMRemoveBalloon
  159.     ENDIF
  160.  
  161.     IF GENERATING68K THEN
  162.         Macro
  163.         _HMGetBalloons
  164.             move.w    #$0003,d0
  165.             dc.w     $A830
  166.         EndM
  167.     ELSE
  168.         IMPORT    HMGetBalloons
  169.     ENDIF
  170.  
  171.     IF GENERATING68K THEN
  172.         Macro
  173.         _HMSetBalloons
  174.             move.w    #$0104,d0
  175.             dc.w     $A830
  176.         EndM
  177.     ELSE
  178.         IMPORT    HMSetBalloons
  179.     ENDIF
  180.  
  181.     IF GENERATING68K THEN
  182.         Macro
  183.         _HMShowMenuBalloon
  184.             move.w    #$0E05,d0
  185.             dc.w     $A830
  186.         EndM
  187.     ELSE
  188.         IMPORT    HMShowMenuBalloon
  189.     ENDIF
  190.  
  191.     IF GENERATING68K THEN
  192.         Macro
  193.         _HMGetIndHelpMsg
  194.             move.w    #$1306,d0
  195.             dc.w     $A830
  196.         EndM
  197.     ELSE
  198.         IMPORT    HMGetIndHelpMsg
  199.     ENDIF
  200.  
  201.     IF GENERATING68K THEN
  202.         Macro
  203.         _HMIsBalloon
  204.             move.w    #$0007,d0
  205.             dc.w     $A830
  206.         EndM
  207.     ELSE
  208.         IMPORT    HMIsBalloon
  209.     ENDIF
  210.  
  211.     IF GENERATING68K THEN
  212.         Macro
  213.         _HMSetFont
  214.             move.w    #$0108,d0
  215.             dc.w     $A830
  216.         EndM
  217.     ELSE
  218.         IMPORT    HMSetFont
  219.     ENDIF
  220.  
  221.     IF GENERATING68K THEN
  222.         Macro
  223.         _HMSetFontSize
  224.             move.w    #$0109,d0
  225.             dc.w     $A830
  226.         EndM
  227.     ELSE
  228.         IMPORT    HMSetFontSize
  229.     ENDIF
  230.  
  231.     IF GENERATING68K THEN
  232.         Macro
  233.         _HMGetFont
  234.             move.w    #$020A,d0
  235.             dc.w     $A830
  236.         EndM
  237.     ELSE
  238.         IMPORT    HMGetFont
  239.     ENDIF
  240.  
  241.     IF GENERATING68K THEN
  242.         Macro
  243.         _HMGetFontSize
  244.             move.w    #$020B,d0
  245.             dc.w     $A830
  246.         EndM
  247.     ELSE
  248.         IMPORT    HMGetFontSize
  249.     ENDIF
  250.  
  251.     IF GENERATING68K THEN
  252.         Macro
  253.         _HMSetDialogResID
  254.             move.w    #$010C,d0
  255.             dc.w     $A830
  256.         EndM
  257.     ELSE
  258.         IMPORT    HMSetDialogResID
  259.     ENDIF
  260.  
  261.     IF GENERATING68K THEN
  262.         Macro
  263.         _HMSetMenuResID
  264.             move.w    #$020D,d0
  265.             dc.w     $A830
  266.         EndM
  267.     ELSE
  268.         IMPORT    HMSetMenuResID
  269.     ENDIF
  270.  
  271.     IF GENERATING68K THEN
  272.         Macro
  273.         _HMBalloonRect
  274.             move.w    #$040E,d0
  275.             dc.w     $A830
  276.         EndM
  277.     ELSE
  278.         IMPORT    HMBalloonRect
  279.     ENDIF
  280.  
  281.     IF GENERATING68K THEN
  282.         Macro
  283.         _HMBalloonPict
  284.             move.w    #$040F,d0
  285.             dc.w     $A830
  286.         EndM
  287.     ELSE
  288.         IMPORT    HMBalloonPict
  289.     ENDIF
  290.  
  291.     IF GENERATING68K THEN
  292.         Macro
  293.         _HMScanTemplateItems
  294.             move.w    #$0410,d0
  295.             dc.w     $A830
  296.         EndM
  297.     ELSE
  298.         IMPORT    HMScanTemplateItems
  299.     ENDIF
  300.  
  301.     IF GENERATING68K THEN
  302.         Macro
  303.         _HMExtractHelpMsg
  304.             move.w    #$0711,d0
  305.             dc.w     $A830
  306.         EndM
  307.     ELSE
  308.         IMPORT    HMExtractHelpMsg
  309.     ENDIF
  310.  
  311.     IF GENERATING68K THEN
  312.         Macro
  313.         _HMGetDialogResID
  314.             move.w    #$0213,d0
  315.             dc.w     $A830
  316.         EndM
  317.     ELSE
  318.         IMPORT    HMGetDialogResID
  319.     ENDIF
  320.  
  321.     IF GENERATING68K THEN
  322.         Macro
  323.         _HMGetMenuResID
  324.             move.w    #$0314,d0
  325.             dc.w     $A830
  326.         EndM
  327.     ELSE
  328.         IMPORT    HMGetMenuResID
  329.     ENDIF
  330.  
  331.     IF GENERATING68K THEN
  332.         Macro
  333.         _HMGetBalloonWindow
  334.             move.w    #$0215,d0
  335.             dc.w     $A830
  336.         EndM
  337.     ELSE
  338.         IMPORT    HMGetBalloonWindow
  339.     ENDIF
  340.  
  341.     ENDIF ; __BALLOONS__
  342.